using System;
using System.Xml;
using PropertyExpression.Common;

namespace PropertyExpression.ControllableQuery.Toolkit
{
    internal class ParamInfo
    {
        public readonly string Name;
        public readonly Func<ParamInfo, IOptionalValue<string>> SqlDeclareInfoFunc;
        public readonly Func<ParamInfo, XmlDocument, XmlNamespaceManager, string> SqlTypeFunc;
        public readonly Type ParamType;
        public readonly Action<SqlParamInfo, string, Type> CheckParameterTypeAction;

        public ParamInfo(
            string name,
            Func<ParamInfo, IOptionalValue<string>> sqlDeclareInfoFunc,
            Func<ParamInfo, XmlDocument, XmlNamespaceManager, string> sqlTypeFunc,
            Type paramType,
            Action<SqlParamInfo, string, Type> checkParameterTypeAction)
        {
            Name = name;
            SqlDeclareInfoFunc = sqlDeclareInfoFunc;
            SqlTypeFunc = sqlTypeFunc;
            ParamType = paramType;
            CheckParameterTypeAction = checkParameterTypeAction;
        }
    }
}